package com.sv.jm.baselibrary.http;

import com.sv.jm.baselibrary.event.EventAction;
import com.sv.jm.baselibrary.response.BaseRespone;


import java.io.File;
import java.util.Map;

import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import rx.Observable;

/**
 * Created by Administrator on 2017/5/23.
 */

public interface HttpService {
    /**
     * post提交json字符串 例子
     *
     * @param postBody
     * @return
     */
    @POST("token")
    Observable<BaseRespone> loginService(@Body String postBody);

    /**
     * post提交表单 例子
     *
     * @param mapBody
     * @return
     */
    @POST("api/login")
    Observable<BaseRespone> loginService(@Body Map<String, String> mapBody);

    /**
     * 单文件上传 例子
     *
     * @param file
     * @return
     */
    @Multipart
    @POST("api/upload")
    Observable<BaseRespone> upLoad(@Part("file") File file);
}
